package cn.jiyun.springcloud_feign_provider.controller;

import cn.jiyun.User;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("user")
public class UserController {

    @RequestMapping("{id}")
    public User getUser(@PathVariable Integer id){
        if(id == 1){
            throw new RuntimeException("123");
        }
        return new User(id,"张三",18);
    }

}
